
exports.selectActivity = 'select id, title, date, "activity" as type from c_activity where title like "%"?"%"';

exports.selectResearchResult = 'select id, title, date, "ResearchResult" as type from research_result where title like "%"?"%"';

exports.selectResearchTopic = 'select id, title, date, "ResearchTopic" as type from research_topic where title like "%"?"%"';

exports.selectExchange = 'select id, title, date, "exchange" as type from c_exchange where title like "%"?"%"';

exports.selectAll = 'select id,title,date,type from (select id,title,date,"exchange" as type from c_exchange union select id,title,date,"researchTopic" as type from research_topic union select id,title,date,"researchResult" as type from research_result union select id,title,date,"activity" as type from c_activity) alias where title like "%"?"%" order by date desc limit ?,?';

exports.total = 'select sum(score) as total from (select count(id)  score from c_exchange where title like "%"?"%" union select count(id)  score from research_result where  title like "%"?"%" union select count(id)  score from research_topic where title like "%"?"%" union select count(id)  score from c_activity where  title like "%"?"%")as tb;'

